from math import sqrt


def is_prime(n):
    assert n > 0
    for factor in range(2, int(sqrt(n))+1):
        if n % factor == 0:
            return False
    return True if n != 1 else False